package com.tedu.api;

import org.junit.Test;

public class ZuoYe {
    @Test
    public void testLength() {
        String s = "HelloJava";
        System.out.println(s.length());

    }

@Test
    public void IndexOf(){
        String str = "HelloJava";
        int index=str.indexOf("o");
        System.out.println(index);
        index=str.indexOf("o",5);
        System.out.println(index);
    }
   @Test
   public void substring(){
        String str="HelloJava";
        String s1=str.substring(0,5);
        System.out.println(s1);
        String s2=str.substring(5,9);
        System.out.println(s2);
        String s3=str.substring(5,6);
        System.out.println(s3);

   }


    @Test
    public void testTrim() {
        String str = " Hello ";
        str = str.trim();
        System.out.println(str);
    }


    @Test
    public void testCharAt() {
        String str = "HelloJava";
        char c = str.charAt(5);
        System.out.println( c);
    }


    @Test
    public void testZuoYe(){
        String str="HelloJava";
        str=str.toLowerCase();
        System.out.println(str);
        str=str.toUpperCase();
        System.out.println(str);
    }
}
